printing: Properly initialize auth_info in gtkprintbackend.c
authorDariusz Gadomski <dariusz.gadomski@canonical.com>
Thu, 2 Oct 2014 12:10:39 +0000 (14:10 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 7 Oct 2014 22:53:57 +0000 (18:53 -0400)
auth_info should be a NULL-terminated array as it is used in
e.g. g_strdupv invocations iterating over its elements until
a NULL element is encountered.

https://bugzilla.gnome.org/show_bug.cgi?id=737777

gtk/gtkprintbackend.c

index 31a181bddcaab2c6ec74b5580eca7c14ee6e77d1..3dc40379efa70efda3d25254a11121ec1fd8f0f6 100644 (file)
@@ -756,7 +756,7 @@ request_password (GtkPrintBackend  *backend,
 
   priv->auth_info_required = g_strdupv (ai_required);
   length = g_strv_length (ai_required);
-  priv->auth_info = g_new0 (gchar *, length);
+  priv->auth_info = g_new0 (gchar *, length + 1);
   priv->store_auth_info = FALSE;
 
   dialog = gtk_dialog_new_with_buttons ( _("Authentication"), NULL, GTK_DIALOG_MODAL,